﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class News_ReplyComment : System.Web.UI.Page
{
    PM.PMSys.guestbook aguestbook = new PM.PMSys.guestbook();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Loadsys();
        }
    }
    protected void Loadsys()
    {
        if (Request["id"]!=null&&Request["name"]!=null&&Session["name"]!=null&&Session["usertype"]!=null&&Session["usertype"].ToString()!="1")
        {
            lblname.Text = Request["name"].ToString();
            lblComment.Text = aguestbook.ReturnComment(Request["id"].ToString());
        }
        else
        {
            PM.Code.Web.alertmessage.ShowMsg("回复页面调用失败,请返回重试。", "GuestBook.aspx");
        }
    }
    protected void btnReply_Click(object sender, EventArgs e)
    {
        bool a=aguestbook.ReplyComment(Request["id"].ToString(), Session["name"].ToString(), TextBox1.Text);
        if (a)
        {
            aguestbook.PassComment(Request["id"].ToString());
            PM.Code.Web.alertmessage.ShowMsg("回复成功!", "GuestBook.aspx");
        }  
    }
    protected void btnpass_Click(object sender, EventArgs e)
    {
        bool a=aguestbook.PassComment(Request["id"].ToString());
        if (a)
        {
            PM.Code.Web.alertmessage.ShowMsg("留言通过审核并已显示!", "GuestBook.aspx");
        }
    }
}
